import { Request } from '@/utils/request';

const url = {
    login: "/entry/login",
    logout: "/entry/logout",
    register: "/entry/register",
    getVerCode: "/entry/register",
    getVerCodeForget: "/entry/forget",
    verifyVerCodeForget: "/entry/forgetVerify",
    resetPassword:"/entry/forget",
};

export const entry = {
    // 登录
    login: function (params: any) {
        return Request.axiosInstance({
            url: url.login,
            method: 'post',
            data: params
        })
    },
    // 登出
    logout: function (params: any) {
        return Request.axiosInstance({
            url: url.logout,
            method: 'post',
            data: params
        })
    },
    // 注册
    register:function(params:any){
        return Request.axiosInstance({
            url: url.register,
            method: 'post',
            data: params
        })
    },
    //注册界面获取验证码
    getVerCode:function(params:any){
        return Request.axiosInstance({
            url: url.getVerCode,
            method: 'get',
            params: params
        })
    },
    //忘记密码界面获取验证码
    getVerCodeForget:function(params:any){
        return Request.axiosInstance({
            url: url.getVerCodeForget,
            method: 'get',
            params: params
        })
    },
    verifyVerCodeForget:function(params:any){
        return Request.axiosInstance({
            url: url.verifyVerCodeForget,
            method: 'get',
            params: params
        })
    },
    resetPassword:function(params:any){
        return Request.axiosInstance({
            url: url.resetPassword,
            method: 'post',
            data: params
        })
    },
}